﻿<Window x:Class="Wizard.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Wizard Sample"
        Width="750"
        Height="446">
    <Window.Background>
        <ImageBrush ImageSource="Resources/beans.jpg"
                    Opacity="0.6"
                    Stretch="Fill" />
    </Window.Background>
    <StackPanel Orientation="Horizontal">
        <!--buttons-->
        <StackPanel Orientation="Vertical"
                    Height="247">
            <Button Padding="7,3.5"
                    Margin="11"
                    Content="Plain Wizard"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Click="Plain_Click" />
            <Button Padding="7,3.5"
                    Margin="11"
                    Content="Route Can Change"
                    VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Click="RouteChanging_Click" />
        </StackPanel>
        <!--host-->
        <Grid>
            <Grid.Resources>
                <Style TargetType="{x:Type Button}">
                    <Setter Property="Padding"
                            Value="3.5,0" />
                    <Setter Property="Margin"
                            Value="3.5" />
                    <Setter Property="MinWidth"
                            Value="80" />
                </Style>

                <!-- This Style inherits from the Button style seen above. -->
                <Style BasedOn="{StaticResource {x:Type Button}}"
                       TargetType="{x:Type Button}"
                       x:Key="finishButtonStyle">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=WizardVM.IsOnLastStep}"
                                     Value="True">
                            <Setter Property="IsEnabled"
                                    Value="True" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=WizardVM.IsOnLastStep}"
                                     Value="False">
                            <Setter Property="IsEnabled"
                                    Value="False" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <Canvas Grid.Row="0" x:Name="wizardHost">
            </Canvas>
            <Border Grid.Row="1" Background="LightGray">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <!-- NAVIGATION BUTTONS -->
                    <Grid Grid.Column="2"
                          Grid.IsSharedSizeScope="True"
                          HorizontalAlignment="Right">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition SharedSizeGroup="Buttons" />
                            <ColumnDefinition SharedSizeGroup="Buttons" />
                            <ColumnDefinition Width="11" />
                            <ColumnDefinition SharedSizeGroup="Buttons" />
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0"
                                x:Name="btnBack"
                                Grid.Row="0"
                                Command="{Binding WizardVM.MovePreviousCommand}"
                                Content="&lt; Back"
                                Margin="4,5,3,3" />
                        <Button Grid.Column="1"
                                x:Name="btnNext"
                                Command="{Binding WizardVM.MoveNextCommand}"
                                Content="Next &gt;"
                                Margin="4,5,3,3" />
                        <Button Grid.Column="3"
                                Grid.Row="0"
                                Style="{StaticResource finishButtonStyle}"
                                Click="Finish_Click"
                                Content="Finish" />
                    </Grid>
                </Grid>
            </Border>
        </Grid>
    </StackPanel>
</Window>
